#include <stdio.h>
//计算分段函数
void main()
{
    float x,y;
    printf("please enter x= ");
    scanf("%f",&x);
    if (x < 0)
    y = x + 20;
    else if (x >= 0 || x < 10)
    y = x*x;
    else if (x >= 10)
    y = 3*x-3;
    printf("y=%.2f",y);

}